<?php require_once('../../core/import.php');?>
<?php User::Permission('LINK_ADD'); ?>
<?php
    if($_SERVER['REQUEST_METHOD']=='POST')
    {
        #上传数据
	  $Data=DB::GetRows('select M_OrderWeight from link order by M_OrderWeight desc limit 1');
        $OrderWeight=NULL;
        if($Data)
        {
            $OrderWeight=$Data[0]['M_OrderWeight'];
            if($OrderWeight){
                $OrderWeight+=1;
            }
            else{
                $OrderWeight=1;
            }
        }
        else{
           $OrderWeight=1;
        }
        DB::Insert('link',array
		(
			'Name'=>Functions::FormArgs('Name_Add'),
			'URL'=>Functions::FormArgs('URL_Add'),
           		'M_OrderWeight'=>$OrderWeight
		));
	  //信息统计
	  User::Statistics_User('LINK_ADD','link','其它版块');
	  Functions::JsLocation('list.php');
    }
?>